.class Lcom/tendcloud/tenddata/du$a;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic a:Lcom/tendcloud/tenddata/du;


# direct methods
.method private constructor <init>(Lcom/tendcloud/tenddata/du;)V
    .locals 0

    iput-object p1, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/tendcloud/tenddata/du;Lcom/tendcloud/tenddata/dv;)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/tendcloud/tenddata/du$a;-><init>(Lcom/tendcloud/tenddata/du;)V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 8

    const-string v0, "PushLog"

    const-string v1, "start read"

    invoke-static {v0, v1}, Lcom/tendcloud/tenddata/cs;->a(Ljava/lang/String;Ljava/lang/String;)V

    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v0}, Lcom/tendcloud/tenddata/du;->d(Lcom/tendcloud/tenddata/du;)Z

    move-result v0

    if-eqz v0, :cond_4

    iget-object v0, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v0}, Lcom/tendcloud/tenddata/du;->c(Lcom/tendcloud/tenddata/du;)Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/tendcloud/tenddata/br;->c(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_3

    :try_start_0
    iget-object v0, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v0}, Lcom/tendcloud/tenddata/du;->c(Lcom/tendcloud/tenddata/du;)Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/tendcloud/tenddata/ct;->a(Landroid/content/Context;)Lcom/tendcloud/tenddata/ct$a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tendcloud/tenddata/ct$a;->a()Z

    move-result v1

    if-eqz v1, :cond_2

    iget-object v1, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v1}, Lcom/tendcloud/tenddata/du;->b(Lcom/tendcloud/tenddata/du;)Lcom/tendcloud/tenddata/cx;

    move-result-object v1

    invoke-virtual {v1, v0}, Lcom/tendcloud/tenddata/cx;->connect(Lcom/tendcloud/tenddata/ct$a;)V

    :goto_1
    iget-object v0, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v0}, Lcom/tendcloud/tenddata/du;->d(Lcom/tendcloud/tenddata/du;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v0}, Lcom/tendcloud/tenddata/du;->b(Lcom/tendcloud/tenddata/du;)Lcom/tendcloud/tenddata/cx;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tendcloud/tenddata/cx;->b()V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :catch_0
    move-exception v0

    iget-object v1, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v1}, Lcom/tendcloud/tenddata/du;->c(Lcom/tendcloud/tenddata/du;)Landroid/content/Context;

    move-result-object v1

    const-string v2, "talkingdata_app_default_push_preferences"

    const-string v3, "mpush_shared_line_error"

    const-wide/16 v4, 0x0

    invoke-static {v1, v2, v3, v4, v5}, Lcom/tendcloud/tenddata/bu;->b(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;J)J

    move-result-wide v2

    long-to-int v1, v2

    iget-object v2, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v2}, Lcom/tendcloud/tenddata/du;->c(Lcom/tendcloud/tenddata/du;)Landroid/content/Context;

    move-result-object v2

    const-string v3, "talkingdata_app_default_push_preferences"

    const-string v4, "mpush_shared_line_error"

    add-int/lit8 v1, v1, 0x1

    int-to-long v6, v1

    invoke-static {v2, v3, v4, v6, v7}, Lcom/tendcloud/tenddata/bu;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;J)V

    const-string v1, "PushLog"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "read err :"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v0}, Lcom/tendcloud/tenddata/cs;->e(Ljava/lang/String;Ljava/lang/String;)V

    :cond_1
    :goto_2
    iget-object v0, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v0}, Lcom/tendcloud/tenddata/du;->d(Lcom/tendcloud/tenddata/du;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-wide/32 v0, 0x186a0

    :try_start_1
    invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1

    goto/16 :goto_0

    :catch_1
    move-exception v0

    const-string v0, "PushLog"

    const-string v1, "thread sleep error "

    invoke-static {v0, v1}, Lcom/tendcloud/tenddata/cs;->e(Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_0

    :cond_2
    :try_start_2
    const-string v0, "PushLog"

    const-string v1, "loc failed"

    invoke-static {v0, v1}, Lcom/tendcloud/tenddata/cs;->e(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_2
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_2

    :cond_3
    const-string v0, "PushLog"

    const-string v1, "Network is not connected"

    invoke-static {v0, v1}, Lcom/tendcloud/tenddata/cs;->e(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_2

    :cond_4
    iget-object v0, p0, Lcom/tendcloud/tenddata/du$a;->a:Lcom/tendcloud/tenddata/du;

    invoke-static {v0}, Lcom/tendcloud/tenddata/du;->b(Lcom/tendcloud/tenddata/du;)Lcom/tendcloud/tenddata/cx;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tendcloud/tenddata/cx;->c()V

    return-void
.end method
